package server.config;

import server.HttpServlet;

import java.io.InputStream;

/**
 * 记录Server信息
 */
public class Server {
    /**
     * Service对象
     */
    private Service service;

    /**
     * 根据给定的URL，获取对应的Servlet
     *
     * @param url 给定的URL
     * @return 对应的Servlet
     */
    public HttpServlet resolveServlet(String url) {
        return service.resolveServlet(url);
    }

    /**
     * 根据给定的URL，获取对应的静态资源
     *
     * @param url 给定的URL
     * @return 对应的静态资源
     */
    public InputStream resolveStatic(String url) {
        return service.resolveStatic(url);
    }

    public Service getService() {
        return service;
    }

    public void setService(Service service) {
        this.service = service;
    }
}
